//
//  BItMapViewController.m
//  BaseTools
//
//  Created by 李挺哲 on 15/11/17.
//  Copyright © 2015年 ltz. All rights reserved.
//

#import "BItMapViewController.h"
#import "ImageFiltersViewController.h"
#import "ImageProcessViewController.h"
#import "WaterLogoViewController.h"
#import "TowBarCodeViewController.h"
@interface BItMapViewController ()
{
    NSMutableArray *array;
    ImageFiltersViewController *ImageFilterVc;
    ImageProcessViewController *  imageProcessViewController;
    WaterLogoViewController *waterLogoViewController;
    TowBarCodeViewController *tbarVc;
}
@end

@implementation BItMapViewController

- (void)viewDidLoad {
    [super viewDidLoad];
            array=[NSMutableArray array];
     [array addObject:@"官方滤镜Demo"];
    [array addObject:@"二维码生成与识别"];
     [array addObject:@"常用图片处理"];
     [array addObject:@"图片加水印"];
    ImageFilterVc=[[ImageFiltersViewController alloc] init];
    UIStoryboard *story = [UIStoryboard  storyboardWithName:@"Main"  bundle:nil];
    imageProcessViewController=[story instantiateViewControllerWithIdentifier:@"ImageProcessViewController"];
  waterLogoViewController=[[WaterLogoViewController alloc]init];
  
    tbarVc= [story instantiateViewControllerWithIdentifier:@"TowBarCodeViewController"];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

    
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{


    return array.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
   static NSString * ID=@"BitMapUITableViewCell";

    UITableViewCell * cell=[tableView dequeueReusableCellWithIdentifier:ID];
    if (cell==nil) {
        cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    
    
    cell.textLabel.textAlignment=NSTextAlignmentCenter;
    cell.textLabel.text=array[indexPath.row];
    return cell;

}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.row) {
        case 0:
            
            [self showViewController:ImageFilterVc sender:self];
            
            break;
        case 1:
              [self showViewController:tbarVc sender:self];
            
            break;
            
        case 2:
             [self showViewController:imageProcessViewController sender:self];
            
            break;
        case 3:
            [self showViewController:waterLogoViewController sender:self];
                        break;
            
        default:
            break;
    }




}

@end
